import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../../common.dart';

class Rule extends StatefulWidget {
  @override
  State<Rule> createState() => _SettingPageState();
}

class _SettingPageState extends State<Rule> {
  RxMap info = {}.obs;

  getInfo() {
    getData(url: '/turntable').then((res) {
      if (res != null) {
        info.value = res;
      }
    });
  }

  @override
  void initState() {
    super.initState();
    WidgetsBinding.instance.addPostFrameCallback((_) {
      getInfo();
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Color(0xffffffff),
        title: Text('活动规则'),
        leading: buildBackButton(context),
        centerTitle: true,
      ),
      body: Padding(
        padding: EdgeInsets.symmetric(vertical: 15, horizontal: 20),
        child: Obx(
          () => Text(
            '${info['info']}',
            style: TextStyle(fontSize: 16, color: Color(0XFF0F172B)),
          ),
        ),
      ),
    );
  }
}
